package com.aaa.web.controller.batterymanger;

import com.aaa.entity.BreakBattery;
import com.aaa.entity.ChangekBattery;
import com.aaa.entity.RepairBattery;
import com.aaa.web.commons.BatteryInfoQuery;
import com.aaa.web.commons.Result;
import com.aaa.web.service.batterymangerservice.ProblemBatteryBIZ;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * com.aaa.web.controller.batterymanger class
 *
 * @author Kevin Jia
 * @CLASS:ProblemBatteryController
 * @Date:2018/12/22 14:44
 */
@Controller
@RequestMapping("/pbbattery")
public class ProblemBatteryController {

    @Autowired
    private ProblemBatteryBIZ problemBatteryBIZ;

    /**
     * @Description: 损坏电瓶的查询
     * @Param:
     * @return:
     * @Author: Kevin Jia
     * @Date: 2018/12/22
     * @Time: 14:49
     */

    @ResponseBody
    @RequestMapping("/getProblemBatterys")
    public Map getProblemBatterys(BatteryInfoQuery query, BreakBattery breakBattery) {
        return problemBatteryBIZ.getProblemBatterys(query, breakBattery);
    }

    /**
     * @Description: 
     * @Param: 
     * @return: 
     * @Author: Kevin Jia
     * @Date: 2018/12/24
     * @Time: 15:37
     */
    @ResponseBody
    @RequestMapping("/addProblemBattery")
    public Result addProblemBattery(BreakBattery breakBattery) {

        return problemBatteryBIZ.addProblemBattery(breakBattery);
    }

    /**
     * @Description: 
     * @Param: 
     * @return: 
     * @Author: Kevin Jia
     * @Date: 2018/12/24
     * @Time: 15:37
     */
    @ResponseBody
    @RequestMapping("/updateProblemBattery")
    public Result updateProblemBattery(BreakBattery breakBattery) {

        return problemBatteryBIZ.updateProblemBattery(breakBattery);
    }

    /**
     * @Description: 
     * @Param: 
     * @return: 
     * @Author: Kevin Jia
     * @Date: 2018/12/24
     * @Time: 15:37
     */
    @ResponseBody
    @RequestMapping("/delProblemBattery")
    public Result delProblemBattery(String id) {

        return problemBatteryBIZ.delProblemBattery(id);
    }

    /**
     * @Description: 
     * @Param:
     * @return: 
     * @Author: Kevin Jia
     * @Date: 2018/12/24
     * @Time: 16:13
     */
    @ResponseBody
    @RequestMapping("/getAddNames")
    public Map getAddNames() {

        return problemBatteryBIZ.getAddNames();
    }

    /**
     * 更换电瓶记录
     * @param query
     * @param changeBattery
     * @return
     */
    @ResponseBody
    @RequestMapping("/getChangeBatterys")
    public Map getChangeBatterys(BatteryInfoQuery query, ChangekBattery changeBattery) {

        return problemBatteryBIZ.getChangeBatterys(query, changeBattery);
    }

    /**
     * 添加记录
     * @param changeBattery
     * @return
     */
    @ResponseBody
    @RequestMapping("/addChangeBattery")
    public Result addChangeBattery(ChangekBattery changeBattery) {

        return problemBatteryBIZ.addChangeBattery(changeBattery);
    }

    /**
     * 修改
     * @param changeBattery
     * @return
     */
    @ResponseBody
    @RequestMapping("/updateChangeBattery")
    public Result updateChangeBattery(ChangekBattery changeBattery) {

        return problemBatteryBIZ.updateChangeBattery(changeBattery);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/delChangeBattery")
    public Result delChangeBattery(String id) {

        return problemBatteryBIZ.delChangeBattery(id);
    }

    /**
     * 维修电瓶记录
     * @param query
     * @param repairBattery
     * @return
     */
    @ResponseBody
    @RequestMapping("/getRepairBatterys")
    public Map getRepairBatterys(BatteryInfoQuery query, RepairBattery repairBattery) {

        return problemBatteryBIZ.getRepairBatterys(query, repairBattery);
    }

    /**
     * 添加记录
     * @param changeBattery
     * @return
     */
    @ResponseBody
    @RequestMapping("/addRepairBattery")
    public Result addRepairBattery(RepairBattery changeBattery) {

        return problemBatteryBIZ.addRepairBattery(changeBattery);
    }

    /**
     * 修改
     * @param repairBattery
     * @return
     */
    @ResponseBody
    @RequestMapping("/updateRepairBattery")
    public Result updateRepairBattery(RepairBattery repairBattery) {

        return problemBatteryBIZ.updateRepairBattery(repairBattery);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/delRepairBattery")
    public Result delRepairBattery(String id) {

        return problemBatteryBIZ.delRepairBattery(id);
    }
    /**
     * @Description: 获取当前门店下的所有员工信息
     * @Param: none
     * @return: Map
     * @Author: Kevin Jia
     * @Date: 2018/12/24
     * @Time: 20:31
     */
    @ResponseBody
    @RequestMapping("/getEmployeeName")
    public Map getEmployeeName() {

        return problemBatteryBIZ.getEmployeeName();
    }




}
